home *** CD-ROM | disk | FTP | other *** search
/ CD ROM Paradise Collection 4 / CD ROM Paradise Collection 4 1995 Nov.iso / program / swags_z.zip / STRINGS.SWG / 0029_Trim spaces from string.pas < prev    next >
Pascal/Delphi Source File  |  1993-09-26  |  669b  |  18 lines

  1. {*****************************************************************************
  2.  * Function ...... AllTrim()
  3.  * Purpose ....... To trim off spaces from either side of a string
  4.  * Parameters .... str        String to trim
  5.  * Returns ....... str with leading and trailing spaces removed
  6.  * Notes ......... Uses function LTrim and RTrim
  7.  * Author ........ Martin Richardson
  8.  * Date .......... May 13, 1992
  9.  *****************************************************************************}
  10. FUNCTION AllTrim( str : STRING ) : STRING;
  11. BEGIN
  12.      IF LENGTH( Str ) > 0 THEN
  13.          AllTrim := LTrim(RTrim(str, ' '), ' ')
  14.      ELSE
  15.          AllTrim := Str;
  16. END;
  17.  
  18.